From: Michael Tokarev Date: Wed, 21 Jan 2026 09:20:05 +0000 (+0300) Subject: inline openat2 syscall X-Git-Tag: archive/raspbian/2%4.23.5+dfsg-1+rpi1^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b08daf886cf4c128eead4becbdab8041750f4c3a;p=samba.git inline openat2 syscall Forwarded: not-needed openat2() is not provided by glibc, so is implemented in samba's libreplace. By inlining the implementation, we avoid additional linkage to libreplace. Not forwarding since proper fix needs proper clean-up of the #ifdef'fery. Gbp-Pq: Name inline-openat2.diff --- diff --git a/lib/replace/system/filesys.h b/lib/replace/system/filesys.h index 9738ad52..130ad4b5 100644 --- a/lib/replace/system/filesys.h +++ b/lib/replace/system/filesys.h @@ -272,10 +272,16 @@ struct __rep_open_how { #endif /* ! HAVE_LINUX_OPENAT2_H */ #ifndef HAVE_OPENAT2 -long rep_openat2(int dirfd, const char *pathname, - struct open_how *how, size_t size); -#define openat2(dirfd, pathname, how, size) \ - rep_openat2(dirfd, pathname, how, size) +#define HAVE_OPENAT2 +#ifdef __linux__ +#include +static inline long openat2(int dirfd, const char *pathname, + struct open_how *how, size_t size) { + return syscall(SYS_openat2, dirfd, pathname, how, size); +} +#else +#define openat2(dirfd, path, how, size) (errno = -ENOSYS, -1) +#endif #endif /* !HAVE_OPENAT2 */ #ifdef DISABLE_OPATH